home *** CD-ROM | disk | FTP | other *** search
- //
- // This is a patch for the Inventor 2.0 Texture code, which can
- // send bad display lists indices to OpenGL. The results can be
- // anything from nothing (OpenGL interprets the command as an empty
- // display list), to random OpenGL calls being made (if the display
- // list index already exists), to a core dump.
- //
- //
- // To apply this patch, compile this file into a .o and then link
- // the .o before -lInventor. The linker may give a warning.
- // This is normal and expected.
- //
-
- #include <Inventor/elements/SoGLTextureImageElement.h>
-
- void
- SoGLTextureImageElement::pop(SoState *state, const SoElement *)
- {
- // Empty texture, don't need to do anything-- the
- // GLTextureEnabledElement will turn off texturing.
- if (size[0] == 0 || size[1] == 0 || numComponents == 0) {
- return;
- }
- // Since popping this element has GL side effects, make sure any
- // open caches capture it
- capture(state);
-
- // Restore previous texture image (if any)
- send(state);
- }
-